/*************************************************************************
	> File Name: 3.378D.cpp
	> Author: hug
	> Mail: hug@haizeix.com
	> Created Time: 三  2/12 10:58:55 2025
 ************************************************************************/

#include <iostream>
#include <queue>
#include <bitset>
using namespace std;

struct Data {
    int x, y;
    bitset<105> vis;
};

int n, m, K, ans = 0;
char g[15][15];

int to_ind(int x, int y) {
    return x * m + y;
}

int dir[4][2] = {
    {0, 1}, {1, 0}, {0, -1}, {-1, 0}
};

void bfs() {
    queue<Data> q;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            if (g[i][j] == '#') continue;
            int ind = to_ind(i, j);
            bitset<105> temp;
            temp[ind] = 1;
            q.push({i, j, temp});
        }
    }
    while (!q.empty()) {
        Data cur = q.front();
        q.pop();
        if (cur.vis.count() == K + 1) {
            ans += 1;
            continue;
        }
        for (int i = 0; i < 4; i++) {
            int dx = cur.x + dir[i][0];
            int dy = cur.y + dir[i][1];
            if (dx < 0 || dx >= n || dy < 0 || dy >= m) continue;
            if (g[dx][dy] == '#') continue;
            if (cur.vis[to_ind(dx, dy)]) continue;
            bitset<105> temp = cur.vis;
            temp[to_ind(dx, dy)] = 1;
            q.push({dx, dy, temp});
        }
    }
    return ;
}

int main() {
    cin >> n >> m >> K;
    for (int i = 0; i < n; i++) cin >> g[i];
    bfs();
    cout << ans << endl;
    return 0;
}
